// pages/indexs/index.js

import { request } from "../request/index.js"
Page({
  data: {
    swiperList:[],
    lunboList:{},
    list:{}
  },
  onLoad: function (options) {
   this.getreqTask();
    this.getData();
  },
  getreqTask(){
    request({
      url: "/home/swiperdata"
    }).then(result => {
      console.log(result)
      this.setData({
        swiperList: result.data.message
      })
    })
  },
  getData(){
    let that=this
      wx.cloud.database().collection("commodityList").get({
        success(res){
          console.log("请求成功",res)
          that.setData({
            list:res.data
          })
        },
        fail(res){
          console.log("请求失败",res)
        }
     })
  },
})